package com.ztp.pc.test2;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JSplitPane;
import java.awt.BorderLayout;
import java.io.IOException;
import java.net.SocketException;

import javax.swing.JPanel;

import com.ztp.lib.files.FtpExplorer;
import com.ztp.pc.gui.fileview.FilePanel;
import com.ztp.pc.gui.gtabpane.GTabPane;

public class RemoteFilePanelTest {

	private JFrame frame;
	public JSplitPane splitPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					RemoteFilePanelTest window = new RemoteFilePanelTest();
					window.frame.setVisible(true);
					window.splitPane.setDividerLocation(0.5);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public RemoteFilePanelTest() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		frame.setBounds(100, 100, 450, 300);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		splitPane = new JSplitPane();
		splitPane.setDividerLocation(0.5);
		frame.getContentPane().add(splitPane, BorderLayout.CENTER);
		
		JPanel panel = new JPanel();
		splitPane.setLeftComponent(panel);
		panel.setLayout(new BorderLayout(0, 0));
		
		GTabPane tabPane = new GTabPane();
		try {
			tabPane.add(new FilePanel(new FtpExplorer("localhost", "my", "my")));
		} catch (SocketException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		
		panel.add(tabPane);
		
		
		
		JPanel panel_1 = new JPanel();
		splitPane.setRightComponent(panel_1);
		
		
		
	}

}
